<?php
/**
 * Created by PhpStorm.
 * User: hasee
 * Date: 2018/7/14
 * Time: 14:09
 */

namespace app\admin\service;


abstract class Token
{
    //获取token
    abstract function getToken($data);
    abstract function getTokenVars($token);
    public function generateToken(){
        //随机字符串
        $randChar = getRandChar(32);
        //盐
        $salt = config('secure.token_salt');
        //时间戳
        $timestamp = $_SERVER['REQUEST_TIME_FLOAT'];
        //md5加密
        return md5($randChar.$timestamp.$salt);
    }
}